const puppeteer = require('puppeteer')
const debug = require('debug')
debug.enable('mifanxing:*')
const SECTION_SELECTOR = 'main>div.container>.row>div>section._Timeline_vdo0u_1>article'
const HEADER_SELECTOR = 'header>h1>a>span'
async function run () {
  const browser = await puppeteer.launch()

  const page = await browser.newPage()
  page.setUserAgent('Mozilla/5.0 (compatible;  Baiduspider/2.0; +http://www.baidu.com/search/spider.html)')
  page.setViewport({width:1920,height:1080})
  const id = 1054301
  await page.goto('http://www.mifanxing.com/p/'+id)

  debug('aas')
  console.log(await page.content())
  await page.screenshot({path: `screenshots/${id}.png`})

  await browser.close()
}

module.exports = run